Confirming the old adage, never buy version 1.0 of anything, here is MacTruePrint Version 1.1 with a fix for those annoying crashes.
Introducing MacTruePrint
MacTruePrint is a Macintosh version of the famous UNIX printing utility, TruePrint, developed by Lezz Giles. It is probably the best printing utility I have ever seen. (You can get the Unix version of TruePrint as well as this version from Lezz's web site at http://www.tiac.net/users/lezz. )
MacTruePrint generates native Postscript code to drive any Postscript printer connected to a Macintosh. MacTruePrint is usually used to print programming source files like those used by Symantec C or C++, Metroworks C, C++, Pascal, text, Pseudo Code, report, etc. It can print shell scripts and Perl scripts (although there are probably not a lot of them on Macintosh systems).
When printing, MacTruePrint can adorn the page with dates, times, file and function names, page numbers, line numbers, indentation levels, etc. MacTruePrint can place each function automatically on a separate page, eliminating the need to do this by hand to get readable listings.
In a multi-file print job, MacTruePrint can produce a File Index and a Function Index.
It can print a single page per physical page, two up on a page, four up on a page, and two up tiny (basically two thin pages of double length side by side in portrait display.)
It can print a greyed out watermark message behind the text, such as Draft, Confidential, etc. It can print greylines every other line, two white, two grey, or three white, three grey, simulating the familiar greenline listing paper we all know and love.
Restrictions
Since MacTruePrint produces native Postscript code, it will not work with a Quickdraw printer. This means most inkjets and some low cost lasers. However, if you use a Postscript Raster Image Processor such as "Freedom of Press" then it should work, but I've never tested it so let me know.
Also, a couple of features of UNIX TruePrint had to be left out, like "diff" and "cflow".
Configuring
MacTruePrint has several configuration options to allow you to get just the kind of listing you want. Several of the configuration options may be saved in the program file for later use.
This means you can have multiple copies of MacTruePrint (with different names) which have options set differently. Since you can print (in system 7.x) by dragging a file or group of files onto the MacTruePrint icon and dropping them, this makes a convenient way to produce different kinds of printouts. For instance you could have one copy named "four up" which prints four on a page, and another called "assembler" which prints in landscape mode with three grey lines.
Preferences
The Preferences dialog box is activated by choosing "Preferences..." from the Options menu.
The following options can be turned on or off by checking and unchecking the item.
Cover Sheet: When checked, a cover sheet bearing the username (as set in the Chooser), the date, the list of files, etc is printed first.
File Index: When checked, multi file print jobs will be preceeded by a file index page showing each file and what functions are contained in that file, on what pages. In single file print jobs, this will not print, even if checked.
Function Index: When checked, a function index page will be printed showing each function, what file it is in and what page it is on. This will not print if there are no functions.
Show Line Numbers: When checked, each line will be numbered and a line number printed in the left margin.
Show Indent Level: When checked, indent level (as defined by the programming language in use) will be tracked and printed in the left margin.
Double Sided: This only works for printers that support duplex printing. But when checked, it should send a message to the printer telling it to enter duplex mode. Since I don't have such a printer, this is untested. (But I have seen the UNIX version do this successfully, so I have hope)
Page Breaks Between Functions: When checked, this will cause a page eject to be inserted at the end of each function, thereby placing the next function at the top of the next page. This may be the program's most useful feature.
Leave Room for Hole Punch: When checked, the width of the printable page is reduced slightly and the image shifted to the right to leave room for punching holes on the left hand side without putting a hole in any of the text. Presumably it does the opposite on even numbered pages in a duplex job, but I haven't been able to test that.
Clever Line Wrap: When checked, the program will attempt to perform line wrap at appropriate places when a line of code gets too long. Otherwise, it will break wherever you run out of room, even in the middle of a word. It also tries to wrap the line is such a way as to place the second line towards the right hand margin, so line trailing comments saty on the right hand side of the page instead of wrapping back to the left hand side.
Honor Page Break Characters: When checked, page break characters (^L) inserted into the text files will cause the succeeding text to be pushed to the top of the next page.
The following options may be specified numerically.
Point Size: This may be thought of as the base point size, if you are printing one up. However if you choose two up, two up tiny or four up, this size will get scaled down to fit the layout on the page. It is normally 9 points.
Interline Gap: This is the amount of space between lines of text. It is normally set to 4 points and I'm not sure why you would really change it, but you can.
Tab Width: Tabs are expanded to 8 characters. However, if you are one of those people who try to use 4 character tab stops, this can be changed here.
In the following options, you must choose one of several choices.
Grey Lines: You can print with no grey lines, every other line grey, two white - two grey, or three white - three grey. This simulates the old green line programming paper we all grew up with. (Now if we could just simulate punched cards ;-)
Orientation: You can select Portrait or Landscape orientation. You should set it here rather than the Page Setup dialog. This is the orientation of the page of text, rather than it's orientation on the physical paper. Portrait is taller than wide, and landscape is wider than tall. This becomes important when combined with Layout.
Layout: One on One prints a single page on the physical page. Two on One splits the physical page into two logical pages after rotating it and prints two pages on the physical page. If you are using portrait mode, the two pages will print side by side in landscape mode, but each page will still be portrait style, ie. taller than wide. If you have selected Landscape mode, the page will be rotated back to portrait mode, but will be comprised of two small but wide pages printed one above the other. Four on One reduces the page to one quarter of a physical page and prints four of them on a single physical page. Two on One (tiny) reduces the font to the size of four on one, but only prints two very tall pages side by side on the physical page.
There are also three buttons.
Help: This just brings up a short help screen for the Preferences Dialog.
Just This Time: This will dismiss the dialog, make the changes and use them in subsequent print jobs initiated from within the MacTruePrint application. The preferences will be lost when you quit MacTruePrint.
Make Default: This will dismiss the dialog, make the changes and save them in the application file. They will be used in subsequent print jobs initiated from within the MacTruePrint application or for any print jobs resulting from dragging and dropping files on this MacTruePrint icon. These preferences will still be here then next time you run MacTruePrint.
Header and Footers
The Headers and Footers dialog box is activated by choosing "Headers and Footers..." from the Options menu.
It will also activate the Insert Menu. Each of the header or footer positions can be set to one of the items on the Insert menu. Use the tab key or click in the position you want to change and then select an item from the Insert menu.
An example of what it will look like is pasted into the field. You CANNOT just type any text you want in these fields (unlike the Unix version of TruePrint.) If you manually change the text in the fields, it will not make any difference to the application. The next time you open the Headers and Footers dialog, it will revert to the standard insertable items.
There are also three buttons in the Headers and Footers dialog.
Help: This just brings up a short help screen for the Headers and Footers Dialog.
Just This Time: This will dismiss the dialog, make the changes and use them in subsequent print jobs initiated from within the MacTruePrint application. The headers and footers will be lost when you quit MacTruePrint.
Make Default: This will dismiss the dialog, make the changes and save them in the application file. They will be used in subsequent print jobs initiated from within the MacTruePrint application or for any print jobs resulting from dragging and dropping files on this MacTruePrint icon. These header and footers will still be here then next time you run MacTruePrint.
Set Language
This item is only needed if you are trying to print a file that does not have an extention which identifies the file type. For instance, all C language files should have the extention .c as in main.c. If you try to print one without such an extension, you will have to set the language before printing.
This is rarely used.
The extentions recognized and their mappings to supported languages are:
.c -> C
.cpp -> C++
.C -> C++
.h -> C
.pc -> Pseudo Code
.ph -> Pseudo Code Header
.rep -> Report
.sh -> Shell
.pas -> Pascal
.pl -> Perl Script
.lst -> List
All else -> TEXT.
Watermark
You can print a greyed out message behind the text of your files by specifying a Watermark message. Open the Watermark Dialog by choosing Watermark... from the Options menu. Type in whatever text you want and choose the OK button. The message will print diagonally across the page, in grey letters, behind the text of your file.
You can use this to print something like "Draft" or "Confidential" on each page.
Adding Files to a Print Job
There are two ways to select files for printing in a single print job. You can select the files in the Finder and drag them onto the MacTruePrint icon of your choice. This will cause MacTruePrint to be launched, the files will be printed (with whatever preferences are set as defaults in the copy of the application) and MacTruePrint will exit.
If you want to print some files with different preferences, but do not want to make another copy of MacTruePrint, you can launch MacTruePrint by double clicking it in the Finder. Once it is running, you can use the Options menu to create whatever set of configuration parameters you want and then select the files for the print job.
Be sure to exit each dialog box with "Just This Time" unless you really want to save the new configuration in the application.
You manually create a print job by using the Open command in the File menu to select each file you want to print. The files selected for printing will be added to a scrolling list. When you have added all the files you want in this print job, then choose Print from the File menu and the print job will start.
When the files have been printed, you can change preferences, create another print job and print some more.
When you are done, choose Quit from the File menu.
Questions, Comments, Complaints.
MacTruePrint is freeware and you may use it on any MAC OS machine and give away copies of it. But please be sure to distribute the application along with this file together. Please consider dropping me an E-mail at GeneTucc@aol.com to let me know you are using MacTruePrint so I can keep you informed of bug fixes and changes.
Also, MacTruePrint may not be included in any collection of Shareware or Freeware distributed by anyone without the expressed written consent of the author.
MacTruePrint is provided as is, with no guarantee of correctness, merchantability, or fitness for any given purpose. The author may not be held liable for any direct or consequential damage as a result of anyone's use of this program.
If you have and questions, comments or complaints, you can send E-mail to me at GeneTucc@aol.com. I don't promise to fix it or change it, but there is a good chance that subsquent versions of MacTruePrint will have the change.
If you are reporting a bug, please be as detailed as possible. Machine, System Version, Printer Type, and if possible the source files that caused the problem.
I will be making some changes to MacTruePrint and if you want to be notified of future versions, just send me E-mail at the above address and I'll put you on the notification list.
Things to do in the next version...
1) find a way to recognize a commented page eject. Mac users cannot easily insert control characters like ^L into a source file. An escape sequence like <EJECT> in a comment could be used instead.
2) Add delete and cancel buttons to the file list window in manual print jobs, so you can remove a file which has been mistakenly added to the print job, or blow the whole thing off if you change your mind.
Known "features"
Sometimes, the printed page seems to be slightly offset and clipped. This is related to the printer in use. I have tested on an NEC Silentwriter 95f, an Apple Laserwriter II, and a TI MicroLaser. They all work OK. I have seen a problem on a new Apple Laserwriter Pro with 600 dpi. Let me know if you see this problem. I know how to solve it, I just don't want to solve it in the way it was solved in UNIX.
Currently a blank page is printed before and after the print job. I forced the one in front to get around a Postscript problem I don't know how to solve yet. I will be tracking down and getting rid of the trailing blank page.
C++ is supported by adding C++ style comments to the C parser. This seems to work OK for all the C++ files I have printed, but I don't guarantee complete C++ compatibility. Lezz and I will be working to integrate full C++ support into the TruePrint printing engine in the future. In the meantime, if you have any problems with C++ files, please let me know so we can try to take them into account. Remember though, if you are using macro expansion in C or C++ to do strange things, the TruePrint parser is not expanding the macros and may therefore get messed up on code which successsfully compiles. Again, any examples you have might be useful so we could try to address them in the long run.
Good Luck!
Gene Tucciarone
GeneTucc@aol.com
Revision History
Version 1.1.
・ Fixed crashes when printing. Usually Type 1 and Type 2 errors and some hangs.
・ Recognize .C as a C++ extension. This is more common as a UNIX extension for C++, but I have run into it.